<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>buffer | 个人博客</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="1.npm 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869&#x2F;&#x2F; 第三方模块 : 别人写好的模块 我们需要手动安装 ， 安装后用法同核心模块&#x2F;&#x2F; 引用的时候 不需要加相对路径或者绝对路径&#x2F;">
<meta property="og:type" content="article">
<meta property="og:title" content="buffer">
<meta property="og:url" content="https://gitee.com/wieldy/bailment-blog/2022/03/29/buffer/index.html">
<meta property="og:site_name" content="个人博客">
<meta property="og:description" content="1.npm 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869&#x2F;&#x2F; 第三方模块 : 别人写好的模块 我们需要手动安装 ， 安装后用法同核心模块&#x2F;&#x2F; 引用的时候 不需要加相对路径或者绝对路径&#x2F;">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2022-03-29T14:12:00.000Z">
<meta property="article:modified_time" content="2023-04-23T12:11:43.651Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/bailment-blog/atom.xml" title="个人博客" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/bailment-blog/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/bailment-blog/css/style.css">

  
    
<link rel="stylesheet" href="/bailment-blog/fancybox/jquery.fancybox.min.css">

  
<meta name="generator" content="Hexo 6.3.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/bailment-blog/" id="logo">个人博客</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/bailment-blog/">Home</a>
        
          <a class="main-nav-link" href="/bailment-blog/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/bailment-blog/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://gitee.com/wieldy/bailment-blog"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-buffer" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/bailment-blog/2022/03/29/buffer/" class="article-date">
  <time class="dt-published" datetime="2022-03-29T14:12:00.000Z" itemprop="datePublished">2022-03-29</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="p-name article-title" itemprop="headline name">
      buffer
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <ul>
<li><p>1.npm</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 第三方模块 : 别人写好的模块 我们需要手动安装 ， 安装后用法同核心模块</span></span><br><span class="line"><span class="comment">// 引用的时候 不需要加相对路径或者绝对路径</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// npm node package manager 包管理工具  当我们安装node后可以直接使用</span></span><br><span class="line"><span class="comment">// 环境变量npm node 安装到环境变量中的都可以直接使用 （只要需要全局使用都需要配置到path中）</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// node里面有3个n   npm   nrm (管理从哪里去下载的)   nvm(在window下 nvm-win) 切换node版本</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// npm install nrm -g  (也可以在项目下创建.npmrc的文件单独对某个项目去配置)</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// npm install nrm -g (安装一个全局的模块，就是可以在命令中直接使用)</span></span><br><span class="line"><span class="comment">// 我们安装的全局包 都会被安装到npm的全局目录下。这样都可以直接使用 （npm目录被放置到了path下）</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 全局模块 （只能在命令行中用，不能在项目中使用）</span></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="variable language_">module</span>.<span class="property">paths</span>); <span class="comment">// C:\Users\test1\AppData\Roaming\npm</span></span><br><span class="line"><span class="comment">// 常见的就是一些编译操作 都是全局模块、脚手架 也都是全局的  （vue/cli,  cra）</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// 1） 我们需要创建可执行文件 添加执行环境 #! /usr/bin/env node</span></span><br><span class="line"><span class="comment">// 2) 配置package.json中的bin参数</span></span><br><span class="line"><span class="comment">// 3) npm link 创建软链到全局下 （为了测试）  或者直接发布 通过npm install -g来进行安装</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 作用域 （@xxx/north  @qqq/north）、 全局的 （会重名）   @bable/core @babel/cli @babel/runtime-core</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// C: \Users\test1\AppData\Roaming\npm\my-npm-package -&gt; C: \Users\test1\AppData\Roaming\npm\node_modules\my-npm-package\bin\www</span></span><br><span class="line"><span class="comment">// C: \Users\test1\AppData\Roaming\npm\node_modules\my-npm-package -&gt; C: \Users\test1\Desktop\promise-1\5.buffer</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 4) 发布的时候 每次版本都需要更新semver 规范 major.minor.patch  (根据测试版本发包的)  beta alpha release</span></span><br><span class="line"><span class="comment">// 5) 发布包 npm publish (如果是向npm官方发布 需要切换到npm源上  登录账号)  --scope</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// npm version 版本号 （major | minor | patch）</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// 第三方模块</span></span><br><span class="line"><span class="comment">// 在项目中安装模块 （这个项目需要用的模块）</span></span><br><span class="line"><span class="comment">// 项目依赖  开发、生产都需要的包 --save 新版本默认不要增加了  vue</span></span><br><span class="line"><span class="comment">// 开发依赖  webpack rollup... --save-dev 开发的时候需要 上线的时候不需要</span></span><br><span class="line"><span class="comment">// 同等依赖  我安装一个包 需要告诉你用一个其他包  bootstrap. jquery  警告</span></span><br><span class="line"><span class="comment">// 可选依赖  你安装不装</span></span><br><span class="line"><span class="comment">// 捆绑依赖  当使用npm pack的时候 会将模块对应的压缩进去</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// npm中package.lock.json 作用就是锁定版本 ^3.6.0 只能比3大的 比4小的 如果有一天包升级到了3.7 (npm install )</span></span><br><span class="line"><span class="comment">// lock文件就是记录好确定的版本 （防止版本安装出问题）  ~2.3.0 只要比2.3大的 比 2.4小的即可  &gt;=  &lt;= &lt; &gt;</span></span><br><span class="line"><span class="comment">// 我只想安装生产依赖 不安装开发依赖  npm install --prodction</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 只要是一个包 必须有package.json   npm init -y</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// npm有个优化处理 会把包拍平 但是版本不一致不会被抽离出来，而是每个包都是自己的</span></span><br><span class="line"><span class="comment">// 服务端代码不用打包。 （后端编译 其实ts-》 js）</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// main 字段是给 require() 用的</span></span><br><span class="line"><span class="comment">// module 字段是给 import</span></span><br><span class="line"><span class="comment">// bin 给执行脚本的时候用的</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 幽灵依赖：  我的项目中用了 a包 -》 b包   b包也会被安装到node_modules下  require(&quot;b&quot;) 有一天a删除了，b就没有了，项目中用了b就出问题了</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 执行脚本</span></span><br><span class="line"><span class="comment">// mime 就是给一个文件名就可以来看下这个文件类型  (例如webpack 我们希望把它安装到全局下么？)</span></span><br><span class="line"><span class="comment">// a用了webpack -》 4.5本地</span></span><br><span class="line"><span class="comment">// b用了webpack -》 5 本地</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 最终将webpack安装到项目下，使用项目中webpack来打包</span></span><br><span class="line"><span class="comment">// 默认通过npm run xxx 的时候 会将当前项目下node_modules/.bin这个目录放到全局的path, 执行后就删除了</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// npx 也可以执行 .bin 目录下的文件 （核心也是将当前的node_modules/.bin）放到环境中，如果没有这个模块会下载， 如果有直接使用</span></span><br><span class="line"><span class="comment">// 如果下载完后  命令执行结束了 会被删除掉 , 初始化项目配置文件可能用到npx</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>
</li>
<li><p>2.buffer</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 1) node 中的模块实现原理 commonjs </span></span><br><span class="line"><span class="comment">// 2) 核心模块的用法  npm第三方模块用法</span></span><br><span class="line"><span class="comment">// 3) global属性 process node EventLoop</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// 我们在node中要操作文件 （文件读写 内存 二进制）  描述内存的 buffer （默认都是二进制数据）</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 转化规则 一个字节由8个bit位组成 （0/1）  二进制逢二进一  十进制是逢10进一  16进制 逢十进1</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 1111111   -&gt; 255   (一个字节最大是255)</span></span><br><span class="line"><span class="comment">// 255 -&gt; 16进制  -&gt; ff</span></span><br><span class="line"><span class="comment">// 255 -&gt; 8进制？ -&gt; 377</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 二进制转化成10进制 可以采用 当前位的值 * 进制^（所在位-1） 累加</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// NODE中的buffer 是以16进制来处理的 （只是因为16进制比较短）  进制只是表现， 一个数可以表现成不同的进制</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 0b开头的是2进制 </span></span><br><span class="line"><span class="comment">// 0o开头的是8进制</span></span><br><span class="line"><span class="comment">// 0x开头的是16进制</span></span><br><span class="line"></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="number">100.</span>.<span class="title function_">toString</span>(<span class="number">16</span>)); <span class="comment">// 64  字符串</span></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="built_in">parseInt</span>(<span class="string">&#x27;1100100&#x27;</span>, <span class="number">2</span>)); <span class="comment">// 可以将任何的进制转化成10进制</span></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="built_in">parseInt</span>(<span class="string">&#x27;ff&#x27;</span>, <span class="number">16</span>)); <span class="comment">// 将进制转化成10进制 </span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 小数怎么转化成2进制   0.1 + 0.2 为啥不等于0.3</span></span><br><span class="line"><span class="comment">// 小数的转化规则 乘二取证法</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 0.1  =&gt; 0.2 -&gt;  0</span></span><br><span class="line"><span class="comment">// 0.2  =&gt; 0.4 -&gt;  0</span></span><br><span class="line"><span class="comment">// 0.4  =&gt; 0.8 -&gt;  0</span></span><br><span class="line"><span class="comment">// 0.8  =&gt; 1.6 -&gt;  1</span></span><br><span class="line"><span class="comment">// 0.6  =&gt; 1.2 =&gt;  1</span></span><br><span class="line"><span class="comment">// 0.2 -&gt; ......   </span></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="number">0.1</span>.<span class="title function_">toString</span>(<span class="number">2</span>)); <span class="comment">// 不能用有限的空间来描述无限的值 （精确 比以前的值大）</span></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="number">0.2</span>.<span class="title function_">toString</span>(<span class="number">2</span>));  <span class="comment">// 得到的肯定是一个近似值 -》 得出了一个偏大的值</span></span><br><span class="line"><span class="comment">// 0.2 + 0.2 近似值</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 那如何解决这个问题呢？ </span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> sum = <span class="number">0</span>;</span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">let</span> i = <span class="number">0</span>; i &lt; <span class="number">8</span>; i++) &#123;</span><br><span class="line">    sum += <span class="number">1</span> * <span class="number">2</span> ** i</span><br><span class="line">&#125;</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(sum)</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="number">2</span> ** <span class="number">8</span> - <span class="number">1</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// base64转化  编码任何东西 基于二进制的 （方便传输）  好处就是base64 可以替换任何的url地址 （减少请求）</span></span><br><span class="line"><span class="comment">// 编码： 不叫加密  (编码可以反编码， 加密需要有对应的秘钥解密， 编码是一套开放的方案)</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// 汉字 node中统一默认只支持utf8格式 一个汉字由3个字节组成  3 * 8 = 24位  </span></span><br><span class="line"></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="title class_">Buffer</span>.<span class="title function_">from</span>(<span class="string">&#x27;珠&#x27;</span>)); <span class="comment">// e7 8f a0</span></span><br><span class="line"></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>((<span class="number">0xe7</span>).<span class="title function_">toString</span>(<span class="number">2</span>))</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>((<span class="number">0x8f</span>).<span class="title function_">toString</span>(<span class="number">2</span>))</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>((<span class="number">0xa0</span>).<span class="title function_">toString</span>(<span class="number">2</span>))</span><br><span class="line"><span class="comment">// 将汉字转化成base64格式  特点就是每一个字节不得超过64 (由64个字符组合而成)</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// 11100111  10001111  10100000 -&gt; 24位   3* 8 =&gt;   4*6</span></span><br><span class="line"><span class="comment">// 111001  111000  111110   100000</span></span><br><span class="line"></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="built_in">parseInt</span>(<span class="string">&#x27;111001&#x27;</span>, <span class="number">2</span>))</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="built_in">parseInt</span>(<span class="string">&#x27;111000&#x27;</span>, <span class="number">2</span>))</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="built_in">parseInt</span>(<span class="string">&#x27;111110&#x27;</span>, <span class="number">2</span>))</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="built_in">parseInt</span>(<span class="string">&#x27;100000&#x27;</span>, <span class="number">2</span>))</span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> code = <span class="string">&#x27;ABCDEFGHIJKLMNOPQRSTUVWXYZ&#x27;</span></span><br><span class="line">code += code.<span class="title function_">toLowerCase</span>();</span><br><span class="line">code += <span class="string">&#x27;0123456789&#x27;</span></span><br><span class="line">code += <span class="string">&#x27;+/&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 57 56 62 32</span></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(code[<span class="number">57</span>] + code[<span class="number">56</span>] + code[<span class="number">62</span>] + code[<span class="number">32</span>]); <span class="comment">// 54+g  4个字节  比以前大了1/3</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// base64 编译出来的结果会比以前大 （不是所有的东西都要转化成base64）</span></span><br><span class="line"><span class="comment">// base32 咋实现的？  00011111 </span></span><br></pre></td></tr></table></figure></li>
</ul>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//package.json</span></span><br><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">  <span class="attr">&quot;name&quot;</span><span class="punctuation">:</span> <span class="string">&quot;@pamzer156/xxx-npm-package&quot;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;public&quot;</span><span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;version&quot;</span><span class="punctuation">:</span> <span class="string">&quot;2.1.1&quot;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;description&quot;</span><span class="punctuation">:</span> <span class="string">&quot;&quot;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;main&quot;</span><span class="punctuation">:</span> <span class="string">&quot;1.npm.js&quot;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;bin&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;n&quot;</span><span class="punctuation">:</span> <span class="string">&quot;./bin/www&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;my-npm-package&quot;</span><span class="punctuation">:</span> <span class="string">&quot;./bin/www&quot;</span></span><br><span class="line">  <span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;scripts&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;mime&quot;</span><span class="punctuation">:</span> <span class="string">&quot;mime&quot;</span></span><br><span class="line">  <span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;keywords&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span><span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;author&quot;</span><span class="punctuation">:</span> <span class="string">&quot;&quot;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;license&quot;</span><span class="punctuation">:</span> <span class="string">&quot;MIT&quot;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;dependencies&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;bootstrap&quot;</span><span class="punctuation">:</span> <span class="string">&quot;^3.0.0&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;mime&quot;</span><span class="punctuation">:</span> <span class="string">&quot;^3.0.0&quot;</span></span><br><span class="line">  <span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;peerDependencies&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;jquery&quot;</span><span class="punctuation">:</span> <span class="string">&quot;^2.0.0&quot;</span></span><br><span class="line">  <span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;optionalDependencies&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span><span class="punctuation">&#125;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;bundledDependencies&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">    <span class="string">&quot;bootstrap&quot;</span></span><br><span class="line">  <span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;devDependencies&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;rollup&quot;</span><span class="punctuation">:</span> <span class="string">&quot;^2.72.0&quot;</span></span><br><span class="line">  <span class="punctuation">&#125;</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="https://gitee.com/wieldy/bailment-blog/2022/03/29/buffer/" data-id="cljmgj1ev000czc9jadmi4e06" data-title="buffer" class="article-share-link">Share</a>
      
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/bailment-blog/2022/03/29/async/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          Async
        
      </div>
    </a>
  
  
    <a href="/bailment-blog/2022/03/29/cookie-session-jwt/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">cookie-session-jwt</div>
    </a>
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/bailment-blog/archives/2023/07/">July 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/bailment-blog/archives/2023/06/">June 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/bailment-blog/archives/2023/04/">April 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/bailment-blog/archives/2023/03/">March 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/bailment-blog/archives/2022/03/">March 2022</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/bailment-blog/2023/07/03/%E5%B7%A5%E4%BD%9C%E6%97%A5%E5%BF%97/">工作日志</a>
          </li>
        
          <li>
            <a href="/bailment-blog/2023/06/29/payMent/">payMent</a>
          </li>
        
          <li>
            <a href="/bailment-blog/2023/06/20/%E7%BD%91%E7%BA%A2%E9%9D%A2%E8%AF%95%E9%A2%98/">原理题</a>
          </li>
        
          <li>
            <a href="/bailment-blog/2023/06/19/%E5%89%8D%E7%AB%AF%E5%A4%A7%E5%B1%8F%E8%87%AA%E9%80%82%E5%BA%94%E6%96%B9%E6%B3%95/">前端大屏自适应方法</a>
          </li>
        
          <li>
            <a href="/bailment-blog/2023/06/17/10%E4%B8%AAJavaScript%E5%B8%B8%E8%A7%81%E9%AB%98%E7%BA%A7%E7%9F%A5%E8%AF%86%E7%82%B9/">10个JavaScript常见高级知识点</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2023 John Doe<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/bailment-blog/" class="mobile-nav-link">Home</a>
  
    <a href="/bailment-blog/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/bailment-blog/js/jquery-3.4.1.min.js"></script>



  
<script src="/bailment-blog/fancybox/jquery.fancybox.min.js"></script>




<script src="/bailment-blog/js/script.js"></script>





  </div>
</body>
</html>